reduce codebase complexity cpp